<?php

require_once('php/lib/configured_object.php');

config('View', 'view');

/**
 * Abstract view.
 *
 * The view is responsible for creating the appropriate output.
 *
 * @abstract
 * @author Pascal de Vink
 */
class View extends ConfiguredObject {

	/**
	 * Renders view contents
	 *
	 * @access public
	 */
	function render() {
		trigger_error(sprintf('%s() not implemented', 'render'), E_USER_ERROR);
	}
	
	/**
	 * Returns view contents
	 *
	 * @access public
	 */
	function content() {
		ob_start();
		$this->render();
		$contents = ob_get_contents();
		ob_end_clean();
		return $contents;
	}
}
?>